package com.ly.video.api.video.impl;

import com.ly.video.api.video.entity.VideoEntity;
import com.ly.video.api.video.mapper.VideoMapper;
import com.ly.video.api.video.service.IVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VideoServiceImpl implements IVideoService {

    @Autowired
    private VideoMapper videoMapper;

    @Override
    public Integer insertVideo(VideoEntity entity) {
        return videoMapper.insertVideo(entity);
    }

    @Override
    public List<VideoEntity> getVideoListByPage(int page, int size) {
        List<VideoEntity> videoEntityList = videoMapper.getVideoByPage((page - 1) * size, size);
        return videoEntityList;
    }
}
